<ol class="nestable dd-list list-unstyled">
    <li class="dd-item" ng-repeat="entity in data">
        <button class="btn btn-info dd-handle pull-left">
            <i class="fa fa-bars"></i>
        </button>
        <button ng-if="entity[entityDef.children]" class="btn btn-default dd-toggle collapsed" data-toggle="collapse"
                data-target="#tt{{entity[entityDef.code]}}">
        </button>
        <div class="dd-content">
            <span>{{entity[entityDef.name]}}</span>

            <tree-content entity="entity"></tree-content>
            <!--<a href="#" class="btn btn-primary btn-xs pull-right" >添加子部门</a>-->
        </div>

        <ol ng-if="entity[entityDef.children]" class="dd-list collapse" id="tt{{entity[entityDef.code]}}" style="height:0;">
            <li class="dd-item" ng-repeat="entity2 in entity[entityDef.children]">
                <button class="btn btn-info dd-handle pull-left">
                    <i class="fa fa-bars"></i>
                </button>
                <button ng-if="entity2[entityDef.children]" class="btn btn-default dd-toggle collapsed" data-toggle="collapse"
                        data-target="#tt{{entity2[entityDef.code]}}">
                </button>
                <div class="dd-content">
                    <span>{{entity2[entityDef.name]}}</span>
                    <tree-content entity="entity2"></tree-content>
                    <!--<a href="#" class="btn btn-primary btn-xs pull-right" >添加子部门</a>-->
                </div>

                <ol ng-if="entity2[entityDef.children]" class="dd-list collapse" id="tt{{entity2[entityDef.code]}}" style="height:0;">
                    <li class="dd-item" ng-repeat="entity3 in entity2[entityDef.children]">
                        <button class="btn btn-info dd-handle pull-left">
                            <i class="fa fa-bars"></i>
                        </button>
                        <div class="dd-content">
                            <span>{{entity3[entityDef.name]}}</span>
                            <tree-content entity="entity3"></tree-content>
                            <!--<a href="#" class="btn btn-primary btn-xs pull-right" >添加子部门</a>-->
                        </div>
                    </li>
                </ol>

            </li>
        </ol>

    </li>
</ol>